Make AtomicBool the same size as bool#33579
Merged
bors merged 1 commit intorust-lang:masterfrom May 14, 2016
Merged
Conversation
4a69546 to
222b551
Compare
Member
Member
|
Note that the libs team discussed this change during triage the other day and the conclusion was that we're amenable to this with the other recent changes to |
Collaborator
bors
added a commit
that referenced
this pull request
May 14, 2016
Make AtomicBool the same size as bool Reopening #32365 This allows `AtomicBool` to be transmuted to a `bool`, which makes it more consistent with the other atomic types. Note that this now guarantees that the atomic type will always contain a valid `bool` value, which wasn't the case before (due to `fetch_nand`). r? @alexcrichton
Collaborator
Contributor
|
@Amanieu Is this a guarantee? Like, on all platforms, all compilers, AtomicBool can be transmuted to bool? Or just specific platforms? |
Member
Author
|
As it is currently implemented, a transmute will work fine. However I am not sure whether we should make this guarantee to users. Note that currently, atomic-rs relies on |
Member
|
When discussed with the libs team, the conclusion was that |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reopening #32365
This allows
AtomicBoolto be transmuted to abool, which makes it more consistent with the other atomic types. Note that this now guarantees that the atomic type will always contain a validboolvalue, which wasn't the case before (due tofetch_nand).r? @alexcrichton